#include <iostream>
#include <iomanip>
#include <vector>
#include <queue>
#include <tuple>
using namespace std;

int main()
{
	int n, m;
	cin >> n >> m;
	vector<vector<vector<int>>> gh(n + 1);
	vector<int> vis(n + 1, 0);
	vector<int> dis(n + 1, INT32_MAX);
        vector<int> steps(n + 1, 0);
	vector<pair<int, int>> pre(n + 1, pair<int, int>(-1, -1));
	for (int i = 0; i < m; i++) {
		int u, v, z;
		cin >> u >> v >> z;
		gh[u].push_back({ v, z });
		gh[v].push_back({ u, z });
	}

	int s, t;
	cin >> s >> t;
	priority_queue<tuple<int, int, int>, vector<tuple<int, int, int>>, greater<>> pq;
	dis[s] = 0;
        steps[s] = 0;
	pq.emplace(0, 0, s );

	while (!pq.empty()) {
		auto [w, len, u] = pq.top();
		pq.pop();
		if (vis[u]) {
			continue;
		}
		vis[u] = 1;

		for (auto e : gh[u]) {
			int v = e[0], z = e[1];
			if (!vis[v] && w + z < dis[v]) {
				dis[v] = z + w;
                                steps[v] = len + 1;
				pq.emplace(dis[v], len + 1, v);
				pre[v] = { u, z };
			}else if(!vis[v] && w + z == dis[v] && len + 1 > steps[v]){
                                dis[v] = z + w;
                                steps[v] = len + 1;
				pq.emplace(dis[v], len + 1, v);
				pre[v] = { u, z };
                        }
		}
	}

	long double money = 100;
	while (pre[t].first != -1) {
		money = money / (1.0 - pre[t].second * 0.01);
		t = pre[t].first;
	}
	cout << setiosflags(ios::fixed) << setprecision(8) << money << endl;
	return 0;
}
